import { PureStandardProps } from "@/src/consts"
import {HomeGoodsModel} from "@/src/lib/models/home_index_model"
import { View } from "@tarojs/components"
import RecommandGoodsItem from "./recommand-goods-item"

import "./recommand-goods.scss"

interface RecommandGoodsProps extends PureStandardProps {
    models?: HomeGoodsModel[]
}

const RecommandGoods = (props: RecommandGoodsProps) => {

    let children = new Array()
    if (props.models) {
        for (const model of props.models) {
            children.push(<RecommandGoodsItem model={model}/>)
        }
    }

    return (
        <View {...props} className={[props.className, "recommand-goods"].join(" ")}>
            { children }
        </View>
    )
}

export default RecommandGoods